$webwork.htmlEncode($page.space.name) : Creating a coverage from a TIFF with world file (tfw)
This page last changed on Apr 09, 2007 by cholmes.
General help about how to create CoverageStores and Coverage is available in the base Geoserver help: 5 CoverageStore Configuration and 6 Coverage Config. They make use of GeoTIFF file format, which has all georeferencing metadata embedded into itself. In order to create a coverage in Geoserver from a georeferenced TIFF (not a GeoTIFF) you need three files:
All files must have same name and different extension:
The World File is an ASCII file containing data about pixel size, raster orientation, etc. A more in-depth discussion about this topic in Geoserver is WorldImage CoverageStore. A reference page is available here: http://www.gdal.org/frmt_various.html#WLD The PRJ (SRS definition) file is another ASCII file needed by the Geoserver WCS module to properly handle the raster: without this file Geoserver isn't able to configure the Coverage and the raster gets a wrong spatial position. Hand-creating this file is very simple: it contains only one line with the WKT of the SRS (the Well Known Text is a standard textual representation of an SRS: Geoserver comes with a complete database of SRS definition, accessible from the main webadmin page). Please keep attention while creating the prj file: the WKT has to be exactly in one line. As usual, you can put all three files somewhere on the server's filesystem, then configure the CoverageStore this way:
After configuring the CoverageStore, you can create the Coverage (refer to the above help page for details). At time of writing there is a relevant issue open, about TIFF+TFW with a rotation angle different from zero: http://jira.codehaus.org/browse/GEOS-928 Keep also in mind that TIFF+TFW are not really meant for high performance. Often the best solution is to use the GeoTIFF format. Given a tif+tfw (gdal_translate doesn't seem to make use of the prj file), you can issue this command (of course on one line: here it's split for readability): gdal_translate -of GTiff -co "PROFILE=GeoTIFF" -co "INTERLEAVE=PIXEL" -co "COMPRESS=LZW" -co "TILED=YES" -a_srs EPSG:4326 raster_with_world_file.tif raster_geotiff.tif (the prj file is replaced by the -a_srs option). As usual, you must have a file named raster_with_world_file.tfw in the same directory. Geoserver gurus tell me it's a good thing to create overview images (to increase performance), but I still haven't tried that (it should involve use of the gdaladdo utility - if someone already used it, he/she's welcome updating this tutorial ). |
Document generated by Confluence on Jan 16, 2008 23:28 |